-
Notifications
You must be signed in to change notification settings - Fork 226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor depency handling, installation, and add a few features #9
Conversation
There are hard copies of the graphviz and pyyaml dependencies included in the repo. Remove these. Sort out installation and dependency handling by writing a functional setup.py script. Rename top level documentation. Refactor wireviz.py slightly to allow it to run as an installed script.
Order imports properly. Fix path when running script directly from repo rather than as an installed package. Refactor command line handling.
There is no obvious way of specifying exactly which cable type (manufacturer, part number) to use for a given cable, which is useful for BOM purposes. Add a 'specified_cable' field to the Cable class to remedy this, and render it both in the graph and the BOM.
Add an inverted dictionary and a lookup function from awg -> mm2. Also do some minor refactoring. Both sides of the conversion table were converted to strings, since '0000' and '2/0' are perfectly valid AWG values.
Show conversions for ex06, and make sure it displays conversions in both directions. Rebuild the example files.
I like this implementation to make it easier to use! One thing that could make it even easier is the first user setup.
Will give a I'm guessing it's because the png and svg libraries it's calling arn't there yet. |
Ah, apart from the graphviz python package (bindings) it also requires the actual graphviz system package; pip doesn't pull that for you. Already had it installed, so didn't catch that -- it's a documentation issue, i'll drop in a fix in the install notes and add to the PR, but an |
Explicitly mention the system graphviz dependency and clarify possible need for separate python install on old ubuntus
cb1d6cd fixes the install instructions as above; verified that no other dependencies are required using a clean dockerized ubuntu. |
- Allow prepending a separate YAML file for e.g. including common template definitions. This is accomodated by a new commandline option, --prepend-file, which takes a path to a YAML file. This is prepended to the regular input as-is. - Refactor file loading to accomodate the above. This includes moving relevant parts to main() and instead supplying parse () with a string representation of the YAML data. Also add early file existance checks and bail out if any of the inputs are inaccessible or nonexistant.
'input' overloads a python built-in name. Refactor to avoid this.
This looks great! I'll try to merge this in the next few days :) |
What would be the best way to split this into multiple merges, to separate the dependency handling + installation from the added features? |
I've cherry picked the commits relevant to dependency handling and refactoring, skipping the added features for now. Will push once I confirm everything works. |
Integrated into dev branch with 7060c38 , please confirm that everything went smoothly! I made some minor changes to make the build_examples.py script work again. |
I've added the project to PyPI 🎉 There's plenty of things to learn and improve, but at least it's out there. Any further assistance on this topic will be highly appreciated, as I have zero previous experience with PyPI and the intricacies of packaging a project... |
Hey,
Great idea and immediately useful, for me. I've done some quick and dirty - but fairly major - refactoring here as follows for my own sake - use it if you wish.